static void
kml_wr_position_deinit(void)
{
- kml_wr_deinit();
+// kml_wr_deinit();
if (posnfilenametmp) {
xfree(posnfilenametmp);
posnfilenametmp = NULL;
track_del_wpt(posn_trk_head, tonuke);
}
-// kml_wr_deinit();
+ kml_wr_deinit();
}
ff_vecs_t kml_vecs = {
is_fatal(xcsv_file.gps_datum < 0, MYNAME ": datum \"%s\" is not supported.", opt_datum);
}
+static void
+xcsv_wr_position_init(const char *fname)
+{
+ xcsv_wr_init(fname);
+}
+
static void
xcsv_wr_deinit(void)
{
- gbfclose(xcsv_file.xcsvfp);
+ gbfclose(xcsv_file.xcsvfp);
- xcsv_destroy_style();
+ xcsv_destroy_style();
+}
+
+static void
+xcsv_wr_position_deinit(void)
+{
+ xcsv_wr_deinit();
+}
+
+
+static void
+xcsv_wr_position(waypoint *wpt)
+{
+ /* Tweak incoming name if we don't have a fix */
+ switch(wpt->fix) {
+ case fix_none:
+ if (wpt->shortname) {
+ xfree(wpt->shortname);
+ }
+ wpt->shortname = xstrdup("ESTIMATED Position");
+ break;
+ default:
+ break;
+ }
+
+ waypt_add(wpt);
+ xcsv_data_write();
+ waypt_del(wpt);
+
+ gbfflush(xcsv_file.xcsvfp);
}
ff_vecs_t xcsv_vecs = {
xcsv_data_write,
NULL,
xcsv_args,
- CET_CHARSET_ASCII, 0 /* CET-REVIEW */
+ CET_CHARSET_ASCII, 0, /* CET-REVIEW */
+ { NULL, NULL, NULL, xcsv_wr_position_init, xcsv_wr_position, xcsv_wr_position_deinit }
+
};
#else
void xcsv_read_internal_style(const char *style_buf) {}
</para>
<para>
As of this writing, Garmin's PVT protocol and NMEA are supported
- inputs and KML is supported on output. Additional formats
- may be added by interested parties later.
+ inputs. KML, NMEA, and the variou XCSV formats are supported on
+ output. Additional formats may be added by interested parties
+ later.
</para>
<para><userinput>gpsbabel -T -i garmin -f usb: -o kml -F xxx.kml</userinput></para>
<para>